package sparkcore.day6.lesson03

/**
  * Created by Administrator on 2018/5/3.
  */
class Sortkey(var clickCount:Long,var orderCount:Long,var payCount:Long)extends
 Ordered[Sortkey] with Serializable
{
  override def compare(that: Sortkey): Int = {
    if(this.clickCount - that.clickCount !=0){
      if(this.clickCount - that.clickCount < 0){
        -1
      }else{
        1
      }
    }else if(this.orderCount -that.orderCount != 0){
       if(this.orderCount - that.orderCount < 0){
         -1
       }else{
         1
       }
    }else{
       if(this.payCount - that.payCount <0){
         -1
       }else{
         1
       }
    }

  }
}
